<?php 
	echo $this->element('reportcss');
	$file_name = "软件著作权统计报表";
	if(empty($report)){?>
<div class="right_side_operate_area">
	<div class="right_side_title left">
		<h2><?php echo $file_name;?></h2>
	</div>
    <?php
    	$url_explode=explode("group=", $_SERVER["QUERY_STRING"]);
    	echo '<div class="right back_btn">';
		echo $html->link("导出报表","/reports/softwarecopyrightreport/1?group=".$url_explode[1]);
		echo '</div>';
	?> 
	<?php echo $this->element('reportgroup'); ?>	
    <div class="clear"></div>
</div>
<div class="right_side_scollbar">
    <div class="detail_info_panel">
        <div class="items_list">
 <?php }?>
 			<?php 
        		if(!empty($report)){
        			echo "<div align='center'><h3>$file_name</h3></div>";
        		}
        	?>
        	<table border='1'>
            	<tr>
            		<th>序号</th>
                    <th>企业名称</th>
                    <th>模块</th>
		 			<th>项目名称</th>
		 			<th>认定时间</th>
                </tr>
		 		<?php 
		 			$i = 1;
		 			foreach($companys as $company)
		 			{
		 				$j = 0;
		 				$company_name = $company["SearchCompany"]["company_name"];//企业名称
		 				$companyPatents = $company["CompanyPatent"];
		 				$patent_num = count($companyPatents);
		 				$groupname = $grouplist[$company["SearchCompany"]["groupid"]];
		 				if($companyPatents)
		 				{
			 				foreach($companyPatents as $patent)
			 				{
			 					$pname = $patent["pname"];//项目名称
			 					$time = "";
			 					if(!empty($patent["authorize_time"]))
			 						$time = date("Y-m-d",strtotime($patent["authorize_time"]));//认定时间
			 					else if(!empty($patent["buy_time"]))
			 						$time = date("Y-m-d",strtotime($patent["buy_time"]));//认定时间
			 					
			 					
			 					echo "<tr>";
			 					if($j == 0)
			 					{
			 						echo "<td align='center' rowspan='".$patent_num."'>".$str->formatCell($i)."</td>";
			 						echo "<td align='center' rowspan='".$patent_num."'>".$str->formatCell($company_name)."</td>";
			 						echo "<td align='center' rowspan='".$patent_num."'>".$str->formatCell($groupname)."</td>";
			 					}
			 					
			 					echo "<td align='center'>".$str->formatCell($pname)."</td>";
			 					echo "<td align='center'>".$str->formatCell($time)."</td>";
			 					echo "</tr>";
			 					$j++;
			 				}
			 				$i++;
		 				}
		 			}
		 		?>
            </table>
<?php if(empty($report)){?>
		</div>
    </div>
</div>
<?php }?>
